Loading TOC...

MarkLogic Server 11.0 Product Documentation
PUT /manage/v2/protected-paths/{id}/properties

Summary

This resource endpoint updates one or more properties of a protected path. Specify the path id in the {id} portion of the request URI.

URL Parameters
format The format of the returned data. Can be either json or xml (default).
Request Headers
Content-type The MIME type of the data in the request body. One of the following MIME types: application/xml, application/json.

Response

A successful call to the endpoint returns the HTTP code 204 No Content. The server successfully processed the request and is not returning any content.

Required Privileges

This operation requires one of the following:

Usage Notes

This structure of the data in the request body is as follows:

The structure of the output returned from this REST API is as follows:

path-id

Identifier for a protected-path definition

path-expression

The XPath that specifies the XML element or JSON property in a protected-path definition

path-namespaces

Namespace bindings

This is a complex structure with the following children:

path-namespace

A namespace binding specification.

This is a complex structure with the following children:

prefix

A QName prefix.

namespace-uri

A namespace URI.

permissions

The default set of permissions used in document creation.

This is a complex structure with the following children:

permission

Permission representation.

This is a complex structure with the following children:

role-id

A role identifier (unique key).

role-name

The Role name (unique)

capability

The action/task permitted by a permission

path-set

Path Set

Example


Assume properties.xml contains the following data:

<protected-path-properties xmlns="http://marklogic.com/manage/protected-path/properties">
  <permissions>
    <permission>
      <role-name>app-user</role-name>
      <capability>read</capability>
    </permission>
    <permission>
      <role-name>hadoop-user-write</role-name>
      <capability>update</capability>
    </permission>
  </permissions>
</protected-path-properties>

curl --anyauth --user username:password -i -X PUT \
  -H "Content-type: application/xml" -d @./properties.xml \
  http://localhost:8002/manage/v2/protected-paths/14320590660078181486/properties

==> The permissions property of the specified protected path is replaced with
    that specified in the request body. MarkLogic returns a response similar 
    to the following:

HTTP/1.1 204 No Content
Server: MarkLogic
Content-Type: text/plain; charset=UTF-8
Content-Length: 20
Connection: Keep-Alive
Keep-Alive: timeout=5
    

Example


curl --anyauth --user username:password -i -X PUT -H "Content-type: application/json" \
  -d {"permission":[{"role-name":"app-user", "capability":"read"} ]} \
  http://localhost:8002/manage/v2/protected-paths/14320590660078181486/properties

==> MarkLogic returns a response similar to the following:

HTTP/1.1 204 No Content
Server: MarkLogic
Content-Type: text/plain; charset=UTF-8
Content-Length: 20
Connection: Keep-Alive
Keep-Alive: timeout=5
    

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.